Derivation of Pi

If we can only compute the circumference and diameter of a circle, then their ratio is $\pi$. We can! However, our precision may be limited by the ability to do arithmetic with large numbers of decimals. This method has no calculus, although the concept of a limit is important. Indeed the idea is to compute the circumference of a circle as the sum of sides of a polygon and then let the number of sides go large. A nice feature is that for each step the number of sides will be doubled and that has the effect of raising the precision of the calculation quickly.

DerivePi_1.png
Figure 1: Begin with a circle of radius, $r$,inscribed inside of a square of side $2a$. If a different polygon were used, we could still define $a$ as $\text{sidelength}/2$.

We could start with any simple circle inscribed inside a polygon. For example, the polygon could be a triangle, a square, a pentagon, you get the idea. I will begin with a square, just because it is easier to describe both the circle radius and the circumscribed polygon side length with integers. You could use a triangle just as well, but then the radius and sidelength could not both begin as integers. I will use a triangle in an example. Here figure 1 shows a circle circumscribed by a square. The side length of the square is $2a$.

DerivePi_2.png
Figure 2: Polygon with twice as many sides as we started, and with additional segments labeled. $a$ is half the length of one side of the largest square. $b$ is half the length of a side of the octogon. $c$ is the addition to $r$ necessary to go to a vertex. $a-b$ is the hypotenuse of right triangle $T2$.

Next we will have a polygon circumscribing the circle with twice as many sides. This needn't be accurately drawn as we will calculate all of the values with little resort to a coordinate system. The new figure 2 has additional labels. $a$ hasn't changed. It is half the length of a side of the largest square. $b$ is half the length of a side of the octogon. $c$ is the addition to $r$ necessary to go to a vertex. $a-b$ is the hypotenuse of right triangle $T2$. Looking at the two right triangles in figure 2, $T1$ and $T2$ we can use Pathagoras and write two equations. $$\text{for T1, }r^{2}+a^{2}=(r+c)^{2}$$ $$\text{for T2, }b^{2}+c^{2}=(a+b)^{2}$$ These equations can be solved together to get $b$ and $c$, although, $b$ is all that we really want. We will not use $c$. $$b=\frac{\pm r\sqrt{a^{2}+r^{2}}-r^{2}}{a}$$ Since $b$ is a length we need the positive root.

So the point is that our calculation of $b$ is very general in that it did not require a fixed number of sides to start. $a$ is simply half the length of a starting polygon side and $b$ is half the length of the next polygon with twice as many sides. Thus we have a formula that permits iteration.

  1. Start with $n$ polygon sides of known length $2a$.
  2. Compute $b$ from the formula.
  3. Keep up with the number of sides. $n:=2n$. Here we are assigning $n$ to be twice as many sides. So now $n$ and $b$ relate to the same polygon.
  4. Assign $a_{1}=b$.
  5. Iterate back to 1, for as long as you want.
  6. When done, $\text{circumference}=n\cdot2b$ and $$\pi=\frac{n\cdot2b}{2r}=\frac{n\cdot b}{r}$$

Therefore, we could continue this to exhaustion - which in my case might not be all that long. By adding up the side lengths of the polygon, we get an estimate of the circle circumference. Precision will depend only on how many decimal places you can keep in the calculations and, of course, starting with high precision values for $r$ and $a$.

Example: Compute $\pi$ using the method of external polygons. Start with a circumscribed triangle, that is, three sides.
TrisectCircle.png
Figure 3: Left panel. The solid circle has radius $1$. The dashed circle has radius $1$ and is centered at the bottom of the solid circle. It intersects the solid circle such that the arc between intersections is $1/3$ of the circle circumference. Right panel. Another circle of radius $1$ has been drawn centered at the intersection of the first two circles. It intersects the solid circle such that another arc is formed of size $1/3$ the circumference.

Answer: Let $r=1$. The we have to compute $a$. We will do this by construction (compass and ruler) and without much precision - and yet we'll do OK. Start with a circle of radius $1$, centered on a vertical line, such as an axis origin. Then from the bottom of the circle, draw a second circle with the same $r=1$. Now from either intersection of the two circles, draw a third circle with still the same radius.

TrisectCircle_1.png
Figure 4: Left Panel. A line from center to intersection point $D$ is drawn (red) followed by an perpendicular line (blue) which intersects the axis exactly $1$ radius above the original circle. Left panel. From intersection point $E$, a line is constructed tangent to the original circle bottom. That line intersects the red line to make the third point in our circumscribed triangle.

Next we will construct a line from the center of the first circle through point $D$ (see figure 4, followed by a perpendicular line at point $D$. The upper intersection of the perpendicular line with the axis line is one point of the circumscribed triangle. By drawing a circle of radius $1$ centered at the top of the solid circle, we can see that the upper point, $I$, crosses the $y$-axis $2$ units above the original center. Now construct a line from the bottom of the solid circle to point $E$.

Finally, connect point $E$ with the bottom of the original circle, which will also connect it to the red line and make the third point of the circumscribed triangle. Since we have a right angle at $D$, and $r=1$, we can easily compute segment $DI$ as $\sqrt{3}$. Of course, in this circumscribed triangle, segment $DI$ is $a$ to start our interations. That is, $a=\sqrt{3}$ and $r=1$. Going through the interations, and keeping up with an enormous number of decimal places produces the following table. Not all of the decimal places are shown in this table.

Iteration number Number of sides a b Calculation of Pi
1 6 1.732050808 0.577350269  3.4641016151377545871)
2 12 0.577350269 0.267949192  3.2153903091734724777)
3 24 0.267949192 0.131652498  3.1596599420975004833)
4 48 0.131652498 0.065543463  3.1460862151314349711)
5 96 0.065543463 0.03273661  3.1427145996453682982)
6 192 0.03273661 0.016363922  3.1418730499798238717)
7 384 0.016363922 0.008181413  3.1416627470568485262)
8 768 0.008181413 0.004090638  3.1416101766046895388)
9 1536 0.004090638 0.002045311  3.1415970343215261520)
10 3072 0.002045311 0.001022654  3.1415937487713520280)
11 6144 0.001022654 0.000511327  3.1415929273850970335)
12 12288 0.000511327 0.000255663  3.1415927220386138183)
13 24576 0.000255663 0.000127832  3.1415926707019980479)
14 49152 0.000127832 6.39159E-05  3.1415926578678444198)
15 98304 6.39159E-05 3.19579E-05  3.1415926546593060325)
16 196608 3.19579E-05 1.5979E-05  3.1415926538571714369)
17 393216 1.5979E-05 7.99E-06  3.1415926536566377881)
18 786432 7.99E-06 3.99E-06  3.1415926536065043759)
19 1572864 3.99E-06 2.00E-06  3.1415926535939710228)
20 3145728 2.00E-06 9.99E-07  3.1415926535908376846)
21 6291456 9.99E-07 4.99E-07  3.1415926535900543500)
22 12582912 4.99E-07 2.50E-07  3.1415926535898585163)
23 25165824 2.50E-07 1.25E-07  3.1415926535898095579)
24 50331648 1.25E-07 6.24E-08  3.1415926535897973183)
25 100663296 6.24E-08 3.12E-08  3.1415926535897942584)
26 201326592 3.12E-08 1.56E-08  3.1415926535897934935)
27 402653184 1.56E-08 7.80E-09  3.1415926535897933022)
28 805306368 7.80E-09 3.90E-09  3.1415926535897932544)
29 1610612736 3.90E-09 1.95E-09  3.1415926535897932424)
30 3221225472 1.95E-09 9.75E-10  3.1415926535897932395)
31 6442450944 9.75E-10 4.88E-10  3.1415926535897932387)
32 1.2885E+10 4.88E-10 2.44E-10  3.1415926535897932385)
33 2.577E+10 2.44E-10 1.22E-10  3.1415926535897932385)
34 5.154E+10 1.22E-10 6.10E-11  3.1415926535897932385)
35 1.0308E+11 6.10E-11 3.05E-11  3.1415926535897932385)
real pi 3.1415926535897932385

It isn't shown in the table, but the original triangle outside the circle has length $6a=6\sqrt{3}$ and with radius $1$, the calculation for $\pi$ is $$\frac{6\sqrt{3}}{2\cdot 1}=5.196152423$$ Not really very good, but as you can see, it improves quickly.

If we did not already know $\pi$, then we would have gone to the trouble of doing the same type of calculation, but using inscribed circles. That would have sqeezed the value and however many decimal places showed, we could be confident that $\pi$ was in between the inscribed and circumscribed calculation. For fun, you could figure out the inscribed circle example yourself. In the example shown here, I carried 100 decimal places in all of the calculations. To do that, you have to use an extended decimal math package. This example used Sagemath.